import Vue from "vue";
import VueRouter from "vue-router";
import allRoutes from "./generateRoute";
//静态路由
import staticRoutes from "./staticRouters";
//动态路由
// import dynamicRoute from "./dynamicRoutes";

Vue.use(VueRouter);

const routes = [
  // {
  //   path: "/",
  //   component: () => import(/*webpackChunName:'home'*/ "@/pages/Home"),
  //   children: [
  //     {
  //       path: "welcome",
  //       component: () =>
  //         import(/*webpackChunName:'welcome'*/ "@/pages/Home/Welcome"),
  //     },
  //   ],
  // },
  // {
  //   path: "/login",
  //   component: () => import(/*webpackChunName:'log'*/ "@/pages/Login"),
  // },
  // ...allRoutes,
  ...staticRoutes,
  //当在permission中动态添加路由后，必须要删除该动态路由
  // dynamicRoute,
];

const router = new VueRouter({
  routes,
});

export default router;
